<!DOCTYPE html>
<html>
<head>
<title>我的订单</title>
<?php $this->load->view('common/include');?>
</head>
<body id="app" v-cloak>
	<header-layout title='Bone Vue'>
		<header-dock align='left'>
			<a href="<?php echo site_url('/user'); ?>"><Icon type="back"></Icon></a>
		</header-dock>
		我的订单
		<layout-box slot="addon">
			<tabs-horizon>
				<tabs-item-horizon :current="tabs[0]" size=3 href="<?php echo site_url('/order/myorder'); ?>">
					全 部 </tabs-item-horizon>
				<tabs-item-horizon :current="tabs[1]" size=3 href="<?php echo site_url('/order/myorder/0'); ?>">待确认</tabs-item-horizon>
				<tabs-item-horizon :current="tabs[2]" size=3 href="<?php echo site_url('/order/myorder/1'); ?>">已确认</tabs-item-horizon>
				<tabs-item-horizon :current="tabs[3]" size=3 href="<?php echo site_url('/order/myorder/2'); ?>">已完成</tabs-item-horizon>
			</tabs-horizon>
		</layout-box>
	</header-layout>
	<layout-main addon=true>
		<div class="bo-none" v-if="empty">
			<div class="icon"><i class="icon iconfont icon-emoji"></i> </div>
			</p>没有相关订单<p>
		</div>
		<layout-box m="1000" p="1111" v-for="item in orders">
			<div class="bo-row bo-ovf " data-id="{{item.id}}">
				<div class="bo-col-4">
				 	<div class="info-item">
				 		<h3 class="name">下单日期</h3>
				 		<p class="content">
				 			{{item.order_time}}
				 		</p>
				 	</div>
				 </div>
				<div class="bo-col-4">
				 	<div class="info-item">
				 		<h3 class="name">订单总额</h3>
				 		<p class="content"><span class="price">{{item.total}}</span> 元</p>
				 	</div>
				 </div>
				 <div class="bo-col-4">
				 	<div class="info-item">
				 		<h3 class="name">订单状态</h3>
				 		<p class="content">
				 			{{orderstate[item.state]}}
				 		</p>
				 	</div>
				 </div>
			 </div>

			 <div class="bo-row" style="text-align:right;padding:10px 0 0 0;text-align:right;border-top:1px #eee solid;margin-top:5px;">
			 	<div class="bo-col-4" style="float:right;">
			 		<button v-if="item.state==0" @click="cancelOrder(item.id)"  class="bo-btn-warm-blank bo-btn-sm">取消订单</button>
				</div>
			 	<div class="bo-col-4" style="float:right;">

				 	<a href="<?php echo site_url('order/detail/id'); ?>/{{item.id}}" class="bo-btn-primary-blank bo-btn-sm">订单详情</a>
				 </div>
			 </div>
		</layout-box>
	</layout-main>
	<script>
	var STATE = <?php echo $state; ?>;
	var ORDERS = <?php echo json_encode($orders);?>;
	</script>
	<script src="js/order.build.js?v=1.1"></script>
</body>
</html>
